<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
        <script type="text/javascript" src="lib/html5shiv.js"></script>
        <script type="text/javascript" src="lib/respond.min.js"></script>
        <![endif]-->
    <link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" href="./../lib/layui/css/layui.css">
    <!--[if IE 6]>
            <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
            <script>DD_belatedPNG.fix('*');</script>
            <![endif]-->
    <title>个人资金流水</title>
</head>

<body>
    <div class="page-container">
        <div class="cl pd-5 bg-1 bk-gray mt-20" style="border:0;background:none"> <span class="l"></span> </div>
        <table class="layui-hide" id="blackList" lay-filter="blacklist"></table>
    </div>

    <input type="" name="select_vvv" id="select_vvv" value="" style="display:none;" />
    <script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="./../lib/layui/layui.js"></script>
    <script type="text/javascript" src="./../static/js/common.js"></script>
    <script>
        var parentId = parent.$("#details_id").val();
        console.log(parentId)
        layui.use('table', function () {
            var table = layui.table
                , form = layui.form;
            table.render({
                elem: '#blackList',
                cellMinWidth: 80,
                url: admin_url + '/kvmUser/userAccountLog',
                // id为重置表格，进行搜索
                id: 'reload',
                request: {
                    pageName: 'page',
                    limitName: 'size'
                },
 
                paresData: function (res) {
                    return {
                        'data': res.data
                    }
                },
                response: {
                    statusCode: 200
                },
                // 传入数据
                where: {
                    tokenUserId: userId,
                    token: token,
                    userId: parentId
                },
                // 回调
                done: function (res, curr, count) {
                    console.log(res)
  
                },
                method: 'post',
                page: 'true',
                cols: [[
                    { checkbox: true, align: 'center' },
                    { field: 'id', title: 'ID', align: 'center',width:80 },
                    {
                        field: 'name', title: '姓名', align: 'center', templet: function (obj) {
                            var item;
                            // 必须使用同步才能把值传出去
                            $.ajax({
                                type: "post",
                                xhrFields: { withCredentials: true },
                                url: admin_url + '/kvmUser/userInfo',
                                data: { tokenUserId: userId, token: token, id: obj.userId },
                                async: false,
                                success: function (data) {
                                    if(data.code == 200 && data.data != null){
                                        console.log(data)
                                    item = '<span>' + data.data.name + '</span>'
                                }else{
                                    item = '<span></span>'
                                }
                                
                                return item;
                                }
                            })
                            return item
                        }
                    },
                    {
                        field: 'changeType', title: '奖金类型', align: 'center', templet: function (obj) {
                            if (obj.changeType == 6) {
                                return '<span  class="layui-badge layui-bg-orange">礼包提成</span>'
                            } else if (obj.changeType == 7) {
                                return '<span class="layui-badge layui-bg-green">团队提成</span>'
                            } else if (obj.changeType == 8) {
                                return '<span class="layui-badge layui-bg-cyan">商品分成</span>'
                            } else if (obj.changeType == 9) {
                                return '<span  class="layui-badge layui-bg-blue">商品返利</span>'
                            }else{
                            return '<span></span>'
                        }
                        }
                    },
                    { field: 'num', title: '奖金金额', align: 'center',templet:function(obj){
                        return '<span>' + Math.abs(obj.num) + '</span>' }},
                    { field: 'createTime', title: '返现时间', align: 'center' }
                ]]
            })
        })
    </script>
</body>

</html>